package org.demo.pattern.flyweight;

import java.util.HashMap;

/**
 * 
 * @author  
 * @date    2011-5-20
 * @file    org.demo.pattern.flyweight.ArtistFactory.java
 */
public class ArtistFactory {

	private static HashMap<String,Artist> pool = new HashMap<String,Artist>();
	
	public static Artist getArtist(String key){
		Artist obj = pool.get(key);
		if (obj == null){
			obj = new Artist(key);
			pool.put(key, obj);
		}
		return obj;
	}
}
